<?php


namespace app\system\controller;

class PublicFile extends AdminBase
{
	public function getlist()
	{
		$options = $this->request->get();
		$options["limit"] = $this->page_size;
		$options["page"] = $this->page_no;
		$result = \app\system\service\PublicFileService::getlist($options);
		$this->response($result["code"], "获取成功", $result["data"], ["count", $result["count"]], ["pages", $result["pages"]]);
	}
	public function del()
	{
		$options = $this->request->post();
		$result = \app\system\service\PublicFileService::del($options);
		if ($result["code"] == 1) {
			$this->response($result["code"], "删除成功");
		} else {
			$this->response($result["code"], $result["msg"]);
		}
	}
	public function batch_del_expire()
	{
		$options = $this->request->post();
		$result = \app\system\service\PublicFileService::batch_del_expire($options);
		if ($result["code"] == 1) {
			$this->response($result["code"], $result["msg"]);
		} else {
			$this->response($result["code"], $result["msg"]);
		}
	}
	public function upload_file()
	{
		$options = $this->request->post();
		$result = \app\system\service\PublicFileService::upload_file($options);
		if ($result["code"] == 1) {
			$this->response($result["code"], $result["msg"], $result["data"]);
		} else {
			$this->response($result["code"], $result["msg"]);
		}
	}
}